import Vue from 'vue'
import router from './router'
import App from './App.vue'
import  axios  from "axios"
import  VueAxios  from "vue-axios"
import env from './env'


// 根据前端的跨域方式做调整
axios.defaults.baseURL = env.baseURL;
axios.defaults.timeout = 8000;
// 拦截器
axios.interceptors.response.use(function (resp) {
   let res = resp.data;
   if(res.status == 0){
       return resp.data
   }else if (res.status == 10){
    //    #是哈希路由
        window.location.href = '/#/login'
   }else{
       alert(res.msg);
   }

})

Vue.use(VueAxios,axios);
Vue.config.productionTip = false

new Vue({
    router,
    render: h => h (App),
}).$mount('#app')